package com.community.itelligentcommunity.community.communityProperty.controller;

import com.community.itelligentcommunity.common.base.controller.GenericController;
import com.community.itelligentcommunity.common.base.service.GenericService;
import com.community.itelligentcommunity.community.communityProperty.entity.EnvironmentInf;
import com.community.itelligentcommunity.community.communityProperty.entity.QueryEnvironmentInf;
import com.community.itelligentcommunity.community.communityProperty.service.EnvironmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;


@Controller
@RequestMapping("/environmentControl")
public class EnvironmentControl extends GenericController<EnvironmentInf, QueryEnvironmentInf> {

    @Autowired
    private EnvironmentService environmentService;


    @Override
    protected GenericService<EnvironmentInf, QueryEnvironmentInf> getService() {

        return environmentService;
    }

    @Override
    public String addPage() throws Exception {
        return "community/communityProperty/environmentControl/add";
    }

    @Override
    public String updatePage(EnvironmentInf entity, Model model) throws Exception {
        entity = getService().get(entity);
        model.addAttribute("entity",entity);
        return "community/communityProperty/environmentControl/update";
    }
}

